package com.example.controller;

import com.example.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: springboot_course
 * @description:
 * @author: ChenZhiXiang
 * @create: 2019-06-28 14:41
 **/
@Controller
public class DemoController {

    @RequestMapping("/success")
    public String success(Map<String, Object> map){
        map.put("czx","从现在");
        return "success";
    }

    @RequestMapping("/study")
    public String study(Map<String, Object> map) {
        List<User> userList = new ArrayList<>();
        userList.add(new User("小梦", 1));
        userList.add(new User("小李", 2));
        userList.add(new User("小张", 1));
        map.put("userList", userList);
        return "study";
    }
}
